home *** CD-ROM | disk | FTP | other *** search
/ Champak 45 / Vol 45.iso / games / escape.swf / scripts / DefineSprite_214 / frame_11 / DoAction.as
Encoding:
Text File  |  2005-08-23  |  692 b   |  34 lines

  1. this.stop();
  2. wait_cnt = 30 + Math.floor(Math.random() * 20);
  3. phase = 0;
  4. phase0 = 0;
  5. phase1 = 0;
  6. a = 0;
  7. this.onEnterFrame = function()
  8. {
  9.    wait_cnt -= 1;
  10.    if(wait_cnt < 0)
  11.    {
  12.       lineMC.clear();
  13.       phase = Math.floor(Math.random() * 2);
  14.       a = Math.floor(Math.random() * 4);
  15.       if(a == 1)
  16.       {
  17.          _root.enemy.robo.gotoAndPlay("gun");
  18.          gotoAndStop(16);
  19.       }
  20.       else if(phase == 0)
  21.       {
  22.          phase0 = 1;
  23.          _root.enemy.robo.gotoAndPlay("laser");
  24.          gotoAndStop(23);
  25.       }
  26.       else
  27.       {
  28.          phase1 = 1;
  29.          _root.enemy.robo.gotoAndPlay("hadou");
  30.          gotoAndStop(38);
  31.       }
  32.    }
  33. };
  34.